//
//  ZLVideoEncoder.h
//  Video
//
//  Created by os on 2021/3/29.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>

#import "ZLAVConfig.h"

@protocol ZLVideoEncoderDelegate <NSObject>

/// h264 数据编码回调
- (void)videoEncodeCallback:(NSData *)h264Data;

/// sps & pps 数据编码回调
- (void)videoEncodeCallbackSps:(NSData *)sps pps:(NSData *)pps;

@end

/// h264硬编码器（编码和回调均在异步队列执行）
@interface ZLVideoEncoder : NSObject

@property (nonatomic, strong) ZLVideoConfig *config;
@property (nonatomic, weak) id<ZLVideoEncoderDelegate> delegate;

- (instancetype)initWithConfig:(ZLVideoConfig *)config;

/// 编码
- (void)encodeVideoSampleBuffer:(CMSampleBufferRef)sampleBuffer;

@end
